/**
 * 
 */
package com.tx.think;

import static com.tx.think.Print.*;

/**
 * 
 * @author wanghy
 * @since 2014-1-16
 * 
 */
public class Music1 {
	
	public static void tune(Instrument i) {
		i.play(Note.MIDDLE_C);
	}
	
	public static void tuneAll(Instrument[] e) {
		for (Instrument i : e) {
			tune(i);
		}
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Instrument[] orchestra = {
			new Wind(),
			new Percussion(),
			new Stringed(),
			new Brass(),
			new WoodWind()
		};
		tuneAll(orchestra);
	}

}

class Brass extends Wind {
	@Override
	public void play(Note n) {
		print("Brass.play() " + n);
	}
	
	@Override
	void adjust() {
		print("Adjusting Brass");
	}
}

class WoodWind extends Wind {
	@Override
	public void play(Note n) {
		print("WoodWind.play() " + n);
	}
	
	@Override
	String what() {
		return "WoodWind";
	}
}